# -*- coding: utf-8 -*-
'''
The top nth processes which take up CPU and memory space usage are available through this module, additional;
The module can get the system load information.
'''
# Import python libs
import os

# Import salt libs
import salt.utils

def mem(cmd):
    '''
    Return the top nth processes which take up the memory usage for this minion
    CLI Example:
        salt '*' prank.mem <n>
    '''
    output = __salt__['cmd.run_stdout'](cmd)
    res = []
    for line in output.splitlines():
        res.append(lines)
    return output

